<template>
	<view class="flex align-end justify-center">
		<view class="flex flex-1 align-end font px-1">
			<u-input v-model="content" :auto-height="true" height="28" :border="true" type="textarea" placeholder="说点什么..." />
		</view>
		<view class="align-center">
			<view class="mx-2 m-1 u-font-lg font-weight-bold" @click="submit">发送</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				content:""
			}
		},
		methods:{
			submit(){
				//是否为空
				if (this.content === '') {
					return uni.showToast({
						title: '消息不能为空',
						icon: 'none'
					});
				}
				this.$emit('submit',this.content)
				// 清空输入框
				this.content = ''
			}
		}
	}
</script>

<style>
</style>
